package com.example.fresheveryday.service.Impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.fresheveryday.po.Product;
import com.example.fresheveryday.mapper.ProductMapper;
import com.example.fresheveryday.service.ProductService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ll
 * @since 2023-07-05
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {
    @Autowired
    ProductMapper productMapper;

    @Override
    public IPage<Product> getProductByConditions(IPage<Product> page, Wrapper wrapper) {
        return productMapper.getProductByConditions(page,wrapper);
    }

    @Override
    public int countByConditions(Wrapper wrapper) {
        return productMapper.countByConditions(wrapper);
    }

    @Override
    public List<Product> newRecommend(int id) {
        return productMapper.newRecommend(id);
    }

    @Override
    public List<Product> getFifthView() {
        return productMapper.getFifthView();
    }
}
